//
//  AdressModel.m
//  Lmm_IOS
//
//  Created by 张哲炜 on 2018/10/16.
//  Copyright © 2018 lmm. All rights reserved.
//

#import "AdressModel.h"

@implementation AdressModel


// 属性变量转码
-(void)encodeWithCoder:(NSCoder *)aCoder{
    
    [aCoder encodeObject:_mobile forKey:@"mobile"];
    [aCoder encodeObject:_consignee forKey:@"consignee"];
    [aCoder encodeObject:_province forKey:@"province"];
    [aCoder encodeObject:_city forKey:@"city"];
    [aCoder encodeObject:_district forKey:@"district"];
    [aCoder encodeObject:_address forKey:@"address"];
    
}

// 属性变量根据关键字进行逆转码，最后返回对象
-(id)initWithCoder:(NSCoder *)aDecoder{
    if (self = [super init]) {
        
        _mobile = [aDecoder decodeObjectForKey:@"mobile"];
        _consignee = [aDecoder decodeObjectForKey:@"consignee"];
        _province = [aDecoder decodeObjectForKey:@"province"];
        _city = [aDecoder decodeObjectForKey:@"city"];
        _district = [aDecoder decodeObjectForKey:@"district"];
        _address = [aDecoder decodeObjectForKey:@"address"];
        
    }
    return self;
}


@end
